package com.ruoyi.crm.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crm.mapper.SalesOpportunitiesMapper;
import com.ruoyi.crm.domain.SalesOpportunities;
import com.ruoyi.crm.service.ISalesOpportunitiesService;

/**
 * 销售机会Service业务层处理
 *
 * @author fjc
 * @date 2021-08-25
 */
@Service
public class SalesOpportunitiesServiceImpl implements ISalesOpportunitiesService
{
    @Autowired
    private SalesOpportunitiesMapper salesOpportunitiesMapper;

    /**
     * 查询销售机会
     *
     * @param id 销售机会主键
     * @return 销售机会
     */
    @Override
    public SalesOpportunities selectSalesOpportunitiesById(String id)
    {
        return salesOpportunitiesMapper.selectSalesOpportunitiesById(id);
    }

    /**
     * 查询销售机会列表
     *
     * @param salesOpportunities 销售机会
     * @return 销售机会
     */
    @Override
    public List<SalesOpportunities> selectSalesOpportunitiesList(SalesOpportunities salesOpportunities)
    {
        return salesOpportunitiesMapper.selectSalesOpportunitiesList(salesOpportunities);
    }

    /**
     * 新增销售机会
     *
     * @param salesOpportunities 销售机会
     * @return 结果
     */
    @Override
    public int insertSalesOpportunities(SalesOpportunities salesOpportunities)
    {
        return salesOpportunitiesMapper.insertSalesOpportunities(salesOpportunities);
    }

    /**
     * 修改销售机会
     *
     * @param salesOpportunities 销售机会
     * @return 结果
     */
    @Override
    public int updateSalesOpportunities(SalesOpportunities salesOpportunities)
    {
        return salesOpportunitiesMapper.updateSalesOpportunities(salesOpportunities);
    }

    /**
     * 批量删除销售机会
     *
     * @param ids 需要删除的销售机会主键
     * @return 结果
     */
    @Override
    public int deleteSalesOpportunitiesByIds(String[] ids)
    {
        return salesOpportunitiesMapper.deleteSalesOpportunitiesByIds(ids);
    }

    /**
     * 删除销售机会信息
     *
     * @param id 销售机会主键
     * @return 结果
     */
    @Override
    public int deleteSalesOpportunitiesById(String id)
    {
        return salesOpportunitiesMapper.deleteSalesOpportunitiesById(id);
    }
}